package com.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.model.auto.StuSubjectRel;
import com.service.IStuSubjectRelService;
import com.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 学生擅长门类关系表 前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2022-09-14
 */
@RestController
@RequestMapping("/stuSubjectRel")
public class StuSubjectRelController{
    @Autowired
    private IStuSubjectRelService stuSubjectRelService;

    @GetMapping("/getStuSubject")
    public R getStuSubject(Integer stuId) {
        if (stuId == null) R.error();
        System.out.println("传过来的Id" + stuId);
        return R.ok(stuSubjectRelService.list(new LambdaQueryWrapper<StuSubjectRel>()
                .eq(StuSubjectRel::getStuId, stuId)
        ));
    }
}
